import request from "@/utils/request";

export default {
  //添加课程接口
  save(courseinfo) {
    return request({
      url: `/eduservice/educourse/save`,
      method: "post",
      data: courseinfo
    });
  },
  //查询所有讲师接口
  getListTeacher() {
    return request({
      url: `/eduservice/eduteacher/findAll`,
      method: "get"
    });
  },
  //根据编号课程查询接口
  byid(courseid) {
    return request({
      url: `/eduservice/educourse/${courseid}`,
      method: "get"
    });
  },
  //修改课程接口
  updateCourse(courseinfo) {
    return request({
      url: `/eduservice/educourse/update`,
      method: "post",
      data: courseinfo
    });
  },
  //根据编号查询发布信息
  getPublish(courseid) {
    return request({
      url: `/eduservice/educourse/coursepublish/${courseid}`,
      method: "get"
    });
  },
  //发布并且修改状态
  publishCourse(id) {
    return request({
      url: `/eduservice/educourse/puhlish/${id}`,
      method: "get"
    });
  },
  //分页
  getPageList(page, limit, searchObj) {
    return request({
      url: `/eduservice/educourse/${page}/${limit}`,
      method: "get",
      params: searchObj
    });
  },
  //删除所有
  delCourse(id) {
    return request({
      url: `/eduservice/educourse/list/${id}`,
      method: "delete"
    });
  }
};
